package com.example.kt_base.s5

//TODO 83.Kotlin语言的copy函数
data class KtBase93(var name:String,var age:Int){
    var coreInfo:String="核心"
    init {
        println("主构造调用...")
    }

    constructor(name: String):this(name,80){
        println("次构造调用")
        coreInfo="增加非常核心的内容信息.."
    }

    override fun toString(): String {
        return "$name $age $coreInfo"
    }

}
fun main() {

    val p1=KtBase93("deng")
    println(p1)

    val newP2=p1.copy("cheng",22)
    println(newP2)

    //copy 只处理主构造


}
